package com.wzcl.app.dao.model;

import com.fasterxml.jackson.annotation.JsonFormat;
import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import org.hibernate.annotations.DynamicInsert;
import org.hibernate.annotations.DynamicUpdate;
import javax.persistence.*;
import java.io.Serializable;
import java.util.Date;
import java.util.List;

/**
 * @author beingven
 * @Description 课程章节任务表
 * @createTime 2020年12月20日 14:38:00
 */
@Data
@Entity
@Table(name = "catalog_task")
@DynamicUpdate
@DynamicInsert
@JsonIgnoreProperties({"essayCourseCatalog"})
public class CatalogTask implements Serializable {
    @Id
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    private Integer id;

    @ApiModelProperty("章节任务图标")
    private String image;

    @ApiModelProperty("章节任务标题")
    private String title;

    @ApiModelProperty("任务权重")
    private Integer whichNumber;

    @ApiModelProperty("任务视频")
    private String video;

    @ApiModelProperty("任务视频开播语音")
    private String startAudio;

    @JsonFormat(pattern="yyyy-MM-dd",timezone = "GMT+8")
    @ApiModelProperty("课程章节创建时间")
    private Date createTime;

    @JsonFormat(pattern="yyyy-MM-dd",timezone = "GMT+8")
    @ApiModelProperty("课程章节更新时间")
    private Date updateTime;

    @ApiModelProperty("任务当中添加的题的id集合")
    private String questionList;

    @ApiModelProperty("本次任务学习目标")
    private String learningTarget;

    @ApiModelProperty("任务类型 0普通任务 1拍照任务")
    private Integer taskType;

    @ApiModelProperty("任务当中添加的题的id集合")
    @Transient
    private List<EssayCourseQuestionBank> questions;

    @ManyToOne
    @JoinColumn(name = "catalog_id")
    @ApiModelProperty("课程章节id")
    private EssayCourseCatalog essayCourseCatalog;
}